<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>Menu</title>
        <script type="text/javascript">
            addTab = function(url,title){
                alert('add '+url+ ' '+title);
                
            }
        </script>
    </h:head>
    <h:body  style="font-size: 10px;border-spacing: 0;margin: 0;">
       <f:view>
            
            <style type="text/css">
.footer .ui-layout-unit-content {
   background-color: red !important;
}

.content .ui-layout-container{
overflow: auto !important;


}


</style>
           <h:form>     
       <p:layout fullPage="true">
       
           <p:layoutUnit id ="layoutNorth" position="north" size="60">  
                <h:outputText value="Top unit content." />  
            </p:layoutUnit>  

           <p:layoutUnit id="layoutSouth" position="south" size="50">  
                <h:outputText value="South unit content." />  
            </p:layoutUnit>  

            <p:layoutUnit id="layoutWest" position="west" size="200" header="Left Menu" resizable="true" collapsible="true">  
               
                    <p:accordionPanel  value="#{menuBean.listModule}" var="modul" >
                        <p:tab title="#{modul.modulName}" >  
                            <p:tree value="#{modul.rootNode}" var="node" style="width:150px">
                                <!--<c:forEach items="#{modul.rootNode}" var="itemNode">
                                    <h:outputText value="#{itemNode.title}"/>
                                </c:forEach> -->                                           
                                <p:treeNode > 
                                       
                                   <p:commandLink   
        actionListener="#{menuBean.increment}" update="txt_count tabViewMenu"> #{caption.btnSave} Counte2
        <f:param name="val" value="2"></f:param>
        
    </p:commandLink>
                                
                                </p:treeNode>
                               
                            </p:tree>
                        </p:tab>                       
                    </p:accordionPanel>
                    
              
            </p:layoutUnit>  

           <p:layoutUnit position="center" styleClass="content">  
                
           
                 <p:tabView id="tabViewMenu">
              <c:forEach items="#{menuBean.menuTabs}" var="menu">
                   
                   <p:tab title="#{menu.title}" closable="true">  
                       <p:scrollPanel style="width:100%;height:430px">
                           <h:panelGroup rendered="true" style="width:100%;height:430px">
                          
                                 <ui:include src="#{menu.url}" ></ui:include>    
                           
                          <!-- <c:choose>
                               <c:when test="#{menu.url!=null}">
                                   <ui:insert name="myView">
                                   <ui:include src="#{menu.url}" ></ui:include>
                                   </ui:insert>
                               </c:when>
                               <c:otherwise>
                                   <ui:include src="coba.xhtml" ></ui:include>    
                                </c:otherwise>
                           </c:choose> 
                           -->
                       </h:panelGroup>
                      </p:scrollPanel>
                        </p:tab>     
                        
        </c:forEach> 
                    </p:tabView>
                 
            </p:layoutUnit>  

       </p:layout>
               </h:form>   
       </f:view>         
       
    
    </h:body>
</html>

